<style scoped>
.expand-row {
  margin-bottom: 8px;
}
</style>
<template>
    <div>
        <Row class="expand-row">
            <Col span="24">
                <span class="expand-key">设备常规管理: </span>
                <span class="expand-value">{{ convertAccess(row.access.management) }}</span>
            </Col>
        </Row>
        <Row class="expand-row">
            <Col span="24">
                <span class="expand-key">设备定位: </span>
                <span class="expand-value">{{ convertAccess(row.access.location) }}</span>
            </Col>
        </Row>
        <Row class="expand-row">
            <Col span="24">
                <span class="expand-key">设备数据采集: </span>
                <span class="expand-value">{{ convertAccess(row.access.data) }}</span>
            </Col>
        </Row>
        <Row class="expand-row">
            <Col span="24">
                <span class="expand-key">设备效能分析: </span>
                <span class="expand-value">{{ convertAccess(row.access.analysis) }}</span>
            </Col>
        </Row>
        <Row class="expand-row">
            <Col span="24">
                <span class="expand-key">设备计费分析: </span>
                <span class="expand-value">{{ convertAccess(row.access.cost) }}</span>
            </Col>
        </Row>
        <Row class="expand-row">
            <Col span="24">
                <span class="expand-key">设备故障管理: </span>
                <span class="expand-value">{{ convertAccess(row.access.alert) }}</span>
            </Col>
        </Row>
        <Row class="expand-row">
            <Col span="24">
                <span class="expand-key">权限管理: </span>
                <span class="expand-value">{{ convertAccess(row.access.access) }}</span>
            </Col>
        </Row>
    </div>
</template>
<script>
export default {
  props: {
    row: Object
  },
  data() {
    return {
      accessDict: {
        "management-device": "设备管理",
        "management-type": "种类管理",
        "management-tag": "标签管理",
        "location-realtime": "实时定位",
        "location-area": "电子围栏配置",
        "data-hospital": "医疗设备",
        "data-research": "科研设备",
        "analysis-day": "日视图",
        "analysis-hour": "小时视图",
        "analysis-second": "秒视图",
        "cost-record": "计费历史查询",
        "cost-rule": "计费规则配置",
        "alert-list": "故障列表",
        "alert-history": "历史故障",
        "access-role": "角色管理",
        "access-user": "用户管理"
      }
    };
  },
  methods: {
    convertAccess(access) {
      if (access.length <= 0) return "无";
      return access
        .map(item => {
          return this.accessDict[item];
        })
        .join(", ");
    }
  }
};
</script>